<!--#INCLUDE FILE="conn.asp"-->
<!--#include file="md5.asp"-->
<!-- #include file="function_charCode.asp" -->
<!-- #include file="function.asp" -->
<!-- #include file="comSub.asp" -->
<script src=inc/js2.js></script>

<%
if request.form="" then
%>
      <html>
      <SCRIPT Language=JavaScript>
      function setfocus() {
           if (form1.loginusername.value==""){
                form1.loginusername.focus();
                return false;
           }
       }

     function check(theform) {
           if (theform.loginusername.value==""){
                alert("ԲûΪգ");
                theform.loginusername.focus();
                return false;
           }
           if (theform.p1.value==""){
                alert("Բԭ벻Ϊգ");
                theform.p1.focus();
                return false;
           }
           if (theform.p2.value==""){
                alert("Բ벻Ϊգ");
                theform.p2.focus();
                return false;
           }
           if (theform.p3.value==""){
                alert("Բ䲻Ϊգ");
                theform.p3.focus();
                return false;
           }
           if (theform.p2.value!=theform.p3.value){
               alert("Բͬ");
               theform.p2.value=""
               theform.p3.value=""
               theform.p2.focus();
               return false;
           }
       }
      </SCRIPT>
      <body topmargin=0 onload=setfocus()>
      <center>
      <form name=form1 action="ModifyPW.asp" method="post">
            <input type="hidden" name="h1" value="ok">
            <font color="#000070" face="_GB2312" size="4"><b>޸</b></font>
            <table>
                  <tr><td align=left>û<td><input type="text" name="loginusername" size="10">
                  <tr><td align=left>ԭ룺<td><input type=password name=p1 size=10>
                  <tr><td align=left>룺<td><input type=password name=p2 size=10> 
                  <tr><td align=left>: <td><input type=password name=p3 size=10>
<%
               If VCYes() Then
                   Response.Write "<tr><td align=left>֤룺<td><input type='text' name='chknum' size='10'>&nbsp;&nbsp;"
                   Call ImgVCShow()
               End If
%>
            </table>
            <p>
            <input type=submit name=s1 value=" " onclick="return check(this.form);">&nbsp;<input type=reset name=r1 value=" д">
            <input type="reset" value="˳޸" OnClick="self.close();">
      </form>
      </center>
      </body>
      </html>
<%
Else
      dim loginusername,p1,p2,sure
      sure = Request("h1")
      if sure = "ok" Then
            if VCYes() then 
                Call ImgVCShow_handle2()
            end If

            loginusername= Trim(Request("loginusername"))
            p1= Trim(Request("p1"))
            p1= md5(p1)
            p2= Trim(Request("p2"))
            p2= md5(p2)

            sql="select * from ts_userinfo where username='"&loginusername&"'"
            set rs=server.createobject("adodb.recordset")
            rs.open sql,conn,1,1
                  if rs.bof And rs.eof then
                         Response.Write "<SCRIPT language=Javascript>passwords(promptInfo_ModifyPW(0))</SCRIPT>"
                  Else
                         Call clearDLDate(loginusername) 
                         If rs("UserPassword")<>p1 Then
                                Call ExitUL(loginusername)
                                Call sequenceDLCount(loginusername,rs("DLCount"))
                                Response.Write "<SCRIPT language=Javascript>passwords(promptInfo_ModifyPW(1))</SCRIPT>"
                          Else
                                rs("UserPassword")=p2
                                rs.update
                                Response.Write "<SCRIPT language=Javascript>passwords(promptInfo_ModifyPW(2))</SCRIPT>"
		                        Call ImgVCRndnum()
                          end If
                  end if
            rs.close
            Set rs = Nothing
      end if
end if

Call conn_Nothing()
%>


